package org.jiuling.wecom.config;

/**
 * 企业微信配置
 * @author 紫灵
 * @date 2023年04月02日 22时06分56秒
 */
public class WeComConfig {

    /** 应用id */
    private String agentId;
    /** 企业密钥 */
    private String corpSecret;
    /** 企业id */
    private String corpId;

    public String getAgentId() {
        return agentId;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    public String getCorpSecret() {
        return corpSecret;
    }

    public void setCorpSecret(String corpSecret) {
        this.corpSecret = corpSecret;
    }

    public String getCorpId() {
        return corpId;
    }

    public void setCorpId(String corpId) {
        this.corpId = corpId;
    }

    public static Builder builder(){
        return new Builder();
    }

    /** 建造者 */
    public static class Builder{

        /** 企业微信配置 */
        private final WeComConfig weComConfig;

        public Builder(){
            this.weComConfig = new WeComConfig();
        }

        /**
         * 添加应用id
         * @param agentId 应用id
         * @return 建造者对象
         */
        public Builder addAgentId(String agentId){
            weComConfig.agentId = agentId;
            return this;
        }

        /**
         * 添加企业密钥
         * @param corpSecret 企业密钥
         * @return 建造者对象
         */
        public Builder addCorpSecret(String corpSecret){
            weComConfig.corpSecret = corpSecret;
            return this;
        }

        /**
         * 添加企业id
         * @param corpId 企业id
         * @return 建造者对象
         */
        public Builder addCorpId (String corpId){
            weComConfig.corpId = corpId;
            return this;
        }

        /**
         * 建造
         * @return 企业微信配置
         */
        public WeComConfig build(){
            return weComConfig;
        }

    }
}
